package com.beiding.sqlbuilder.impl;

import com.beiding.sqlbuilder.FunType;
import com.beiding.sqlbuilder.Table;
import com.beiding.sqlbuilder.TableField;

public class SimpleTableField implements TableField {

    private String as;

    private FunType fun;

    private Table table;

    private String name;

    SimpleTableField(Table table, String name) {
        this.table = table;
        this.name = name;
    }

    public SimpleTableField as(String as) {
        this.as = as;
        return this;
    }

    public SimpleTableField fun(FunType fun) {
        this.fun = fun;
        return this;
    }

    @Override
    public FunType getFun() {
        return fun;
    }

    @Override
    public String getAs() {
        return as;
    }

    @Override
    public Table getTable() {
        return table;
    }

    @Override
    public String getName() {
        return name;
    }
}
